export default defineEventHandler(event => {
  const qeury = getQuery(event)
  const cookies = parseCookies(event)
  return {
    createdAt: new Date(),

    toJSON() {
      return {
        qeury,
        cookies,
        createdAt: {
          year: this.createdAt.getFullYear(),
          month: this.createdAt.getMonth(),
          day: this.createdAt.getDate()
        }
      }
    }
  }
})
/**
<script setup lang="ts">
// `data` 的类型被推断为
// {
//   createdAt: {
//     year: number
//     month: number
//     day: number
//   }
// }
const { data } = await useFetch('/api/foo')
</script>
 */